/*****************************************************
Copyright (C) 2020. All rights reserved.
File name     ：AvlTree.h
Version       ：v1.0
Author        ：zhengqijun
Date          ：2020-01-16
Function List ：
Description   ：AVL Tree
******************************************************/

#ifndef AVLTREE_H_
#define AVLTREE_H_

// Type Definition
struct AvlNode;
typedef int ElementType;
typedef struct AvlNode *Position;
typedef struct AvlNode *AvlTree;

// Function Lists
AvlTree MakeEmpty(AvlTree T);
int IsEmpty(AvlTree T);
Position Find(ElementType X, AvlTree T);
Position FindMin(AvlTree T);
Position FindMax(AvlTree T);
AvlTree Insert(ElementType X, AvlTree T);
AvlTree Delete(ElementType X, AvlTree T);
Position Left(Position P);
Position Right(Position P);
ElementType Retrieve(Position P);
void PreorderTraversal(AvlTree T);
void InorderTraversal(AvlTree T);
void PostorderTraversal(AvlTree T);
void LevelorderTraversal(AvlTree T);

#endif  /* AVLTREE_H_ */

// EOF

